//
//  PKPlayListTableViewCell.m
//  PianKe
//
//  Created by ybq on 15/12/25.
//  Copyright © 2015年 B7_Young. All rights reserved.
//

#import "PKPlayListTableViewCell.h"

@implementation PKPlayListTableViewCell

- (void)awakeFromNib {
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initUI];
    }
    return self;
}

- (void)initUI {
    
    _stateLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 7, 55)];
    [self.contentView addSubview:_stateLabel];
    
    _titleabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 10, 250, 20)];
    _titleabel.font = [UIFont systemFontOfSize:16];
    [self.contentView addSubview:_titleabel];
    
    _unameLabel = [[UILabel alloc] initWithFrame:CGRectMake(14, 30, 100, 15)];
    _unameLabel.font = [UIFont systemFontOfSize:10];
    _unameLabel.textColor = [UIColor lightGrayColor];
    [self.contentView addSubview:_unameLabel];
    
    _downLoadButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
    _downLoadButton.frame = CGRectMake(kWidth - 40, 20, 20, 20);
    [_downLoadButton setImage:[UIImage imageNamed:@"download"] forState:(UIControlStateNormal)];
    [self.contentView addSubview:_downLoadButton];
}

- (void)setModel:(PKRadioDetailModel *)model {
    _model = model;
    _titleabel.text = model.title;
    _unameLabel.text = [NSString stringWithFormat:@"by: %@",model.uname];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
